package main

import (
	"bubble2/datebase"
	"bubble2/models"
	"bubble2/routers"
)

func main() {
	err := datebase.InitPostgres()
	if err != nil {
		panic(err)
	}
	defer datebase.DB.Close() //程序退出关闭数据库连接
	//建立关联，模型绑定
	datebase.DB.AutoMigrate(&models.Todo{})
	r := routers.SetupRouter()
	r.Run()
}
